import java.util.Scanner;

public class WordCntFSM {

	enum State { COUNT_WORD, COUNT_SPACE, HALT;}
	public static void main(String[] args) {
		
		Scanner in = new Scanner(System.in);
		String line = in.nextLine();
		

		line = " " + line;
		char[] charArray  = new char[line.length()];
		charArray = line.toCharArray();
		int charCnt = 1;
		int position = 0;		
		
		State state = State.COUNT_SPACE;		
		
		while (state != State.HALT){
			
			switch (state) {

				case COUNT_WORD: {
					if (charArray[position ] != ' ' & charArray[position ] != '.') {
						charCnt++;
						state = State.COUNT_WORD;
						break;
					} else if (charArray[position] == ' ') {
						System.out.print(charCnt + " ");
						charCnt = 1;
						state = State.COUNT_SPACE;
						break;
					} else if (charArray[position] == '.') {
						System.out.print(charCnt);
						state = State.HALT;
						break;
					}
				}

				case COUNT_SPACE: {
					if (charArray[position] == ' ') {
						state = State.COUNT_SPACE;
						break;
					} else if (charArray[position] != ' ' & charArray[position] != '.') {
						state = State.COUNT_WORD;
					} else if (charArray[position] == '.') {
						state =  State.HALT;
					}
				}
			}
		
			position++;

		}
		in.close();
	}
}
